package www.wen.com.common.lib.initializer

import android.content.Context
import androidx.startup.Initializer
import com.dylanc.loadinghelper.LoadingHelper
import com.dylanc.loadinghelper.ViewType
import www.wen.com.common.lib.helper.loading.EmptyAdapter
import www.wen.com.common.lib.helper.loading.ErrorAdapter
import www.wen.com.common.lib.helper.loading.LoadingAdapter

/**
 * @author WEN
 * @Description:
 * @date 2020/11/30 3:02
 */
class LoadingHelperInitializer : Initializer<Unit> {

    override fun create(context: Context) {
        LoadingHelper.setDefaultAdapterPool {
            register(ViewType.LOADING, LoadingAdapter())
            register(ViewType.ERROR, ErrorAdapter())
            register(ViewType.EMPTY, EmptyAdapter())
        }
    }

    override fun dependencies(): List<Class<out Initializer<*>>> = emptyList()

}

